<template>
  <div>
    <h5>父组件接收的数据：{{ countFromChild }}</h5>
    <Child @countChange="childCountChange"></Child>
  </div>
</template>

<script>
import Child from "@/components/组件间通信/TestChild.vue";

export default {
  components: {
    Child,
  },
  data() {
    return {
      countFromChild: 0,
    };
  },
  methods: {
    childCountChange(val) {
      this.countFromChild = val;
    },
  },
};
</script>
